import React from 'react';
import { loc, ck_sn, is_disable, ck_empty, useKForm, KDlg, KInput } from 'sui';

const DlgVal = (props) => {
    const form = useKForm(props.data);

    const ck = {
        sn : v => ck_sn(v, props.data, props.main),
        name : v => ck_empty(v),
    };

    return (
        <KDlg {...props} title={loc("l_191")} ck={ck} form={form}>
            <KInput label={loc("l_495")} form={form} name="sn" disabled={is_disable(props.data, "sn")}/>
            <KInput label={loc("l_228")} form={form} name="name"/>
        </KDlg>
    );
};

export {DlgVal};
